import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';

//服务配置管理单条查询
export const querySysMicroServiceConfig = (params) => {
  params.head.transCode = 'querySysMicroServiceConfig';
  return request({
    url: '/micro/sysMicroServiceConfig/querySysMicroServiceConfig',
    method: 'post',
    data: params
  })
}
//服务配置管理多条列表查询，支持条件查询
export const querySysMicroServiceConfigListPage = (params) => {
  params.head.transCode = 'querySysMicroServiceConfigListPage';
  return request({
    url: '/micro/sysMicroServiceConfig/querySysMicroServiceConfigListPage',
    method: 'post',
    data: params
  })
}
//服务配置管理新增单条记录
export const saveSysMicroServiceConfig = (params) => {
  params.head.transCode = 'saveSysMicroServiceConfig';
  return request({
    url: '/micro/sysMicroServiceConfig/saveSysMicroServiceConfig',
    method: 'post',
    data: params
  })
}
//服务配置管理新增多条记录
export const saveSysMicroServiceConfigList = (params) => {
  params.head.transCode = 'saveSysMicroServiceConfigList';
  return request({
    url: '/micro/sysMicroServiceConfig/saveSysMicroServiceConfigList',
    method: 'post',
    data: params
  })
}
//服务配置管理新增或修改单条记录
export const saveOrUpdateSysMicroServiceConfig = (params) => {
  params.head.transCode = 'saveOrUpdateSysMicroServiceConfig';
  return request({
    url: '/micro/sysMicroServiceConfig/saveOrUpdateSysMicroServiceConfig',
    method: 'post',
    data: params
  })
}


//服务配置管理新增或修改单条记录
export const saveOrUpdateSysMicroServiceConfigList = (params) => {
  params.head.transCode = 'saveOrUpdateSysMicroServiceConfigList';
  return request({
    url: '/micro/sysMicroServiceConfig/saveOrUpdateSysMicroServiceConfigList',
    method: 'post',
    data: params
  })
}

//服务配置管理修改单条记录
export const updateSysMicroServiceConfig = (params) => {
  params.head.transCode = 'updateSysMicroServiceConfig';
  return request({
    url: '/micro/sysMicroServiceConfig/updateSysMicroServiceConfig',
    method: 'post',
    data: params
  })
}

//服务配置管理删除单条记录
export const deleteSysMicroServiceConfig = (params) => {
  params.head.transCode = 'deleteSysMicroServiceConfig';
  return request({
    url: '/micro/sysMicroServiceConfig/deleteSysMicroServiceConfig',
    method: 'post',
    data: params
  })
}

//服务配置管理删除多条记录
export const deleteSysMicroServiceConfigList = (params) => {
  params.head.transCode = 'deleteSysMicroServiceConfigList';
  return request({
    url: '/micro/sysMicroServiceConfig/deleteSysMicroServiceConfigList',
    method: 'post',
    data: params
  })
}
//服务配置管理导出excel
export const exportSysMicroServiceConfigExcel = (params) => {
  downloadExcel({
    url: '/micro/sysMicroServiceConfig/excelDownload/exportSysMicroServiceConfigExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
